import React, { Component } from 'react'

export default class CountClass extends Component {
  constructor(){
    super()
    this.state = {
      count: 0
    }
  }
  render() {
    return (
      <div>
        <p>我是类组件，要实现一个计数器的功能</p>
        <button onClick={()=>this.setState({count: this.state.count+1})}>
          点击次数：{this.state.count}
        </button>
      </div>
    )
  }
}
